{
  let a = 10; {
    a = 20
    console.log(a)
  }
  console.log(a)
}

function test(arc) {

  console.log(arc); {
    let arc = 10;
    console.log(arc)
  }
  console.log(arc)
}
test(0);

// 对象转字符串
const obj = {
  id: 0,
  name: '张三',
  age: 12
}
const objToStr = JSON.stringify(obj)
console.log('obj:', obj)
console.log('objToStr:', objToStr)

// 字符串转对象
const str = '{"id":0,"name":"张三","age":12}'
const strToObj = JSON.parse(str)
console.log('str:', str)
console.log('strToObj:', strToObj)

const x = 1
const y = 2
const z = 3
console.count(
  'x 的值为 ' + x + ' 且已经检查了几次？'
)
console.count(
  'x 的值为 ' + x + ' 且已经检查了几次？'
)
console.count(
  'y 的值为 ' + y + ' 且已经检查了几次？'
)
const oranges = ['橙子', '橙子', '橙子']
const apples = ['苹果', '苹果']
oranges.forEach(fruit => {
  console.count(fruit);
})
apples.forEach(fruit => {
  console.count(fruit);
})